import { createStackNavigator } from "react-navigation";
import MainPage from "../pages/main";
import SearchDetailPage from "../pages/home/SearchDetail";
import QRScannerPage from "../pages/home/QRScanner";

const HomeNavigator = {
  SearchDetail: {
    screen: SearchDetailPage,
    navigationOptions: {
      headerBackTitle: null,
    },
  },
};

const MainStack = createStackNavigator(
  {
    // Home: HomeNavigator,
    Home: {
      screen: MainPage,
      navigationOptions: {
        headerBackTitle: null,
      },
    },
    // HomeStack,
    ...HomeNavigator,
    QRScanner: {
      screen: QRScannerPage,
      navigationOptions: {
        headerBackTitle: null,
      },
    },
  },
  {
    initialRouteName: "Home",
    headerTransitionPreset: "uikit",
    headerLayoutPreset: "center",
    headerMode: "none",
    defaultNavigationOptions: {
      gesturesEnabled: false,
    },
  }
);

export default MainStack;
